<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link href="/css/amazeui.min1.css" rel="stylesheet" type="text/css" />
<link href="/user/css/style.css" rel="stylesheet" type="text/css" />
<script src="/user/js/jquery.js"></script>
<script type="text/javascript" src="/skin/js/jquery.dOb.js"></script>
    <script>
        $(function() {
            $("#myBirthDate").dOb({
                dOb_Y: '#dOb_Y', // element year
                dOb_M: '#dOb_M', // element month
                dOb_D: '#dOb_D', // element day
                from_Y: 1950, // from year (default: 2000)
                to_Y: 2023, // to year (default: 2023)
                isPadding: true, // is padding zero (default: true)

            });
        });
    </script>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>会员注册-会员中心</title>
<style>
        .myBirthDate {
            flex: 1;
            overflow: hidden;
            display: flex;
        }
        .myBirthDate select {
            height: 0.48rem;
            line-height: 0.48rem;
            border: 1px solid #acacac;
            margin-left: 10px;
        }
    </style>
</head>
<body class="body">

<header id="header">
	<section class="head-b head-b1">
		<span class="u-left"><a href="javascript:history.go(-1);" class="back"><img src="/skin/img/back.png"></a></span>
		<h1 id="t0">会员注册</h1>
		<div class="u-right" href="#">

		</div>
	</section>
</header>

	<form class="reg">

		<div class="regMain">
			<div class="z-list2">
				<p>账户：</p>
				<input id="uname" type="text" name="t0" class="login_text2" placeholder="账户为8-16位任意字母数字" />
			</div>			
			<div class="z-list2">
				<p>手机号：</p>
				<input id="mobile" type="text" name="t1" class="login_text2" placeholder="请填写11位手机号" />
			</div>			
			<div class="z-list2">
				<p>验证码：</p>
				<input type="text" name="code" placeholder="请填写验证码" /><button type="button" class="yzm">发送验证码</button>
			</div>			
            <div class="z-list2" >
                <p>姓名：</p>
                <input type="text" name="t3" class="login_text2" placeholder="请填写姓名"  />
            </div>			
			<div class="z-list2">
				<p>密码：</p>
				<input type="password" name="t4" class="login_text2" placeholder="请输入6位以上密码" />
			</div>
			<div class="z-list2">
				<p>再次输入密码：</p>
				<input type="password" name="t5" class="login_text2" placeholder="请再次输入密码" />
			</div>
            <!-- <div class="xieyi">
                <div class="xieyiInput">
                    <input type="checkbox" value="1" name="xy" id="xieyi">
                    <label for="xieyi"></label>
                </div>
                <a href="/xieyi.php">请阅读并同意《注册协议》</a>
            </div> -->
		</div>

		<button class="tijiao xtj" type="button" >立即注册</button>

	</form>

	<script>
		

		$(".yzm").on("click",function(){
			let mobile = $("#mobile").val();
			if(mobile.length!=11){
				alert("请输入正确的手机号");return;
			}else{
				let uname = $("#uname").val();
				$.ajax({
					type:"post",
					dataType:"json",
					url:"/Moudelu.php?m=m&a=yzm",
					data:"mobile="+mobile+"&uname="+uname,
					success:function(d){
						if(d[0]==0){
							alert(d[1]);
						}
						else{
							$('.yzm').attr("disabled","disabled");
							alert(d[1]);
							countDown(60);
						}
					}
				});
			}
		});
		
		function countDown(i) {	
			i = i - 1;
			$(".yzm").html(i+"秒后重新发送");  
			if (i == 0) {  
				$(".yzm").html("重新发送");
				$('.yzm').removeAttr("disabled");
				flag = 1;  
				i = 60;  
				return;  
			}			
			setTimeout('countDown('+i+')',1000);  
		}
		$(".tijiao").on("click",function(){
            // if (!$("#xieyi").is(":checked")) {
            //     alert("同意注册协议才能注册");
            //     return;
            // }
			$.ajax({
				type:"post",
				dataType:"json",
				url:"/Moudelu.php?m=m&a=ureg",
				data:$(".reg").serialize(),
				success:function(d){
					if(d[0]==2){
						window.location.href='/login.php';return false;
					}
					if(d[0]==0){
						alert(d[1]);
					}
					else{
						alert(d[1]);
						window.location.href='success.php?uid='+d[2];
					}
				}
			});
		});		
	</script>
	</div>
	</div>
{include(foot)}
</body>
</html>